import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementPlus from "element-plus";
import "@/assets/style/common.scss";
import "element-plus/dist/index.css";
import "@/assets/style/scrollbar.css";
import "nprogress/nprogress.css";
createApp(App).use(store).use(router).use(ElementPlus).mount("#app");

router.beforeEach((to, from, next) => {
  // 获取tabs
  store.commit("getTabs");
  // 设置当前选中的tabs
  store.commit("setActiveTabs", to.name);
  next();
});
